/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package UserInterface;

import BusinessLayer.Facade;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

/**
 *
 * @author Julien
 */
public class GUIVisualisationProfils extends GUI{
    
    private JPanel pannBoutons = new JPanel();
    private JLabel titrevis = new JLabel("Gestion des profils");
    private JButton Valider = new JButton("valider");
    private JButton Retour = new JButton("retour");
    private javax.swing.JTextField nom = new JTextField("Donnez le nom");
    private javax.swing.JTextField prenom= new JTextField("Donnez le prenom");
    private JLabel Identifiant = new JLabel("identifiant");
    private javax.swing.JTextField FieldIdentifiant= new JTextField("Donnez le numero d'identifiant");
    private javax.swing.JTextField mail= new JTextField("Donnez le mail");
    private JLabel ECUE = new JLabel("ECUE :");
    private javax.swing.JTextField fieldECUE= new JTextField("donnez le code matiére enseigné");
    private JLabel UE = new JLabel("UE :");
    private javax.swing.JTextField fieldUE= new JTextField("donnez le codeUE");
    private JLabel Annee = new JLabel("Annee :");
    private javax.swing.JTextField fieldAnnee= new JTextField("donnez le codeAnnée");
    private JLabel Departement = new JLabel("Departement :");
    private javax.swing.JTextField fieldDepartement= new JTextField("donnez le codeDiplome");
    private JLabel titreCombox = new JLabel("sexe :");
    private javax.swing.JComboBox sexe =new JComboBox();
    private JLabel qualification = new JLabel("qualification :");
    private javax.swing.JCheckBox Enseigant= new JCheckBox("Enseignant");
    private javax.swing.JCheckBox ResponsableUE= new JCheckBox("ResponsableUE");
    private javax.swing.JCheckBox ResponsableAnnee= new JCheckBox("ResponsableAnnee");

    public GUIVisualisationProfils()
    {
        super();
        this.conteneurComplement.setLayout(new BorderLayout());
        this.initJlabel();
        this.initJCombox();
        this.conteneurComplement.add(this.titrevis,BorderLayout.NORTH);
        this.titrevis.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        this.conteneurComplement.add(pannBoutons,BorderLayout.CENTER);
        this.pannBoutons.setPreferredSize(new Dimension(50,0));
        this.pannBoutons.setLayout(new GridBagLayout());
        GridBagConstraints c = new GridBagConstraints();
        c.anchor = GridBagConstraints.WEST;
        c.insets = new Insets(0, 0, 0, 0);

        c.gridx = 0;
        c.gridy = 0;
        c.gridwidth = 1;
        c.gridheight = 1;
        c.weightx = 1;
        c.weighty = 1;

        this.pannBoutons.add(this.nom,c);
        this.nom.addActionListener(this);
        this.nom.setActionCommand("nom");

        c.gridx = 1;
        c.gridy = 0;

        this.pannBoutons.add(this.prenom,c);
        this.nom.addActionListener(this);
        this.nom.setActionCommand("prenom");
        
        c.gridx = 2;
        c.gridy = 0;

        this.pannBoutons.add(this.titreCombox,c);
        this.nom.addActionListener(this);
        this.nom.setActionCommand("titreCombox");

        c.gridx = 3;
        c.gridy = 0;

        this.pannBoutons.add(this.sexe,c);
        this.nom.addActionListener(this);
        this.nom.setActionCommand("sexe");

        c.gridx = 4;
        c.gridy = 0;

        this.pannBoutons.add(this.mail,c);
        this.mail.addActionListener(this);
        this.mail.setActionCommand("mail");

        c.gridx = 0;
        c.gridy = 1;

        this.pannBoutons.add(this.qualification,c);

        c.gridx = 1;
        c.gridy = 1;

        this.pannBoutons.add(this.Enseigant,c);
        this.Enseigant.addActionListener(this);
        this.Enseigant.setActionCommand("Enseigant");

        c.gridx = 2;
        c.gridy = 1;

        this.pannBoutons.add(this.ResponsableUE,c);
        this.ResponsableUE.addActionListener(this);
        this.ResponsableUE.setActionCommand("ResponsableUE");

        c.gridx = 3;
        c.gridy = 1;

        this.pannBoutons.add(this.ResponsableAnnee,c);
        this.ResponsableAnnee.addActionListener(this);
        this.ResponsableAnnee.setActionCommand("ResponsableAnnee");

        c.gridx = 0;
        c.gridy = 2;

        this.pannBoutons.add(this.Identifiant,c);
        
        c.gridx = 1;
        c.gridy = 2;

        this.pannBoutons.add(this.FieldIdentifiant,c);
        this.FieldIdentifiant.addActionListener(this);
        this.FieldIdentifiant.setActionCommand("FieldIdentifiant");

        c.gridx = 0;
        c.gridy = 3;

        this.pannBoutons.add(this.ECUE,c);

        c.gridx = 1;
        c.gridy = 3;

        this.pannBoutons.add(this.fieldECUE,c);
        this.fieldECUE.addActionListener(this);
        this.fieldECUE.setActionCommand("fieldECUE");

        c.gridx = 0;
        c.gridy = 4;

        this.pannBoutons.add(this.UE,c);

        c.gridx = 1;
        c.gridy = 4;

        this.pannBoutons.add(this.fieldUE,c);
        this.fieldUE.addActionListener(this);
        this.fieldUE.setActionCommand("fieldUE");

        c.gridx = 0;
        c.gridy = 5;

        this.pannBoutons.add(this.Annee,c);

        c.gridx = 1;
        c.gridy = 5;

        this.pannBoutons.add(this.fieldAnnee,c);
        this.fieldAnnee.addActionListener(this);
        this.fieldAnnee.setActionCommand("fieldAnnee");

        c.gridx = 0;
        c.gridy = 6;

        this.pannBoutons.add(this.Departement,c);

        c.gridx = 1;
        c.gridy = 6;

        this.pannBoutons.add(this.fieldDepartement,c);
        this.fieldDepartement.addActionListener(this);
        this.fieldDepartement.setActionCommand("fieldDepartement");

        c.gridx = 3;
        c.gridy = 6;

        this.pannBoutons.add(this.Valider,c);
        this.Valider.addActionListener(this);
        this.Valider.setActionCommand("Valider");







        


          this.fenetre.pack();
    }

       public void actionPerformed(ActionEvent e) {
       //redirection lors de la connexion
       if (e.getSource()==Valider) {


          
                //GUIGestionPromos pagesuivante = new GUIGestionPromos();
                 //GUIGestionProfils pagesuivante = new GUIGestionProfils();
                String sexe = (String) this.sexe.getSelectedItem();

          //      Facade.AjouterEnseignant(this.nom.getText(),this.prenom.getText(),sexe,this.mail.getText(),this.FieldIdentifiant.getText());

             
              // this.fenetre.dispose();
              }
       }


    public void initJlabel() {
        this.titrevis.setFont(new java.awt.Font("Tahoma", 0, 16));
        this.titrevis.setForeground(new java.awt.Color(0, 153, 153));

    }

    public void initJboutons() {

    }
    public void initJFields() {

    }

    public void initJCombox() {

        sexe.setPreferredSize(new Dimension(100,20));
        sexe.addItem("Homme");
        sexe.addItem("Femme");
      //  sexe.addItemListener(new ItemState());
        //sexe.addActionListener(new ItemAction());
        sexe.setPreferredSize(new Dimension(100,20));
       // sexe.setForeground(Color.blue);

    }

    public void initJCheckbox() {

    }

}
